<%@ page language="java" import="java.util.*,java.io.IOException,java.io.PrintWriter,java.util.ArrayList,java.util.List,java.util.Map" 
pageEncoding="ISO-8859-1"%>
<%@ page import="com.sms.user.*,net.sf.json.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
       response.setContentType("text/html;charset=utf-8");		
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		String msg="";
		//String str=request.getParameter("str");
		//System.out.println(str);
		String role=request.getParameter("role");
		String name=request.getParameter("name");
		String no=request.getParameter("sno");
		String type=request.getParameter("stu_type");
		String major=request.getParameter("major");
		String oripsw=request.getParameter("oripsw");
		String newpsw=request.getParameter("newpsw");
		System.out.println(role);
		System.out.println(newpsw);
		if(role.equals("xuesheng")){
		if(User.modifyinfo(no, name, oripsw, major, type, newpsw))
		{
		  msg="ok";
		}else {msg="error";}}else if(role.equals("laoshi")){
		
		if(User.modifyinfo( no, name, oripsw,newpsw))
		{
		  msg="ok";
		}else {msg="error";}
		
		
		}
		JSONArray json = new JSONArray();
	JSONObject j = new JSONObject();
	j.put("text", msg);	
	json.add(j);
	
	out.clear();
	out.println(json);
		


 %>


